home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
language
/
gfaxpert.lzh
/
GFAXPERT.LIB
/
SCREEN.LST
< prev
next >
Wrap
File List
|
1986-10-19
|
8KB
|
275 lines
' ******************
' *** SCREEN.LST ***
' ******************
'
DEFWRD "a-z"
'
> PROCEDURE initio.logical.screen
' *** install second screen as logical screen
' *** if necessary, move original screen to logical screen (last line)
' *** all graphical commands go to logical screen (screen.2)
' *** PRINT always goes to physical screen (monitor) !!
' *** uses Standard Global physbase%
' *** global : SCREEN.1% SCREEN.2%
DIM screen.2|(32256) ! reserve room for second screen
screen.2%=VARPTR(screen.2|(0))
screen.2%=screen.2%+256-(screen.2% MOD 256) ! screen on 256-byte border
screen.1%=physbase%
~XBIOS(5,L:screen.2%,L:-1,-1) ! invisible screen.2 is now active
' BMOVE screen.1%,screen.2%,32000 ! move original screen to screen.2
RETURN
' ***
> PROCEDURE swap.screen
' *** call this Procedure if drawing-screen is finished
' *** physical and logical screen are swapped
' *** continue with drawing on the invisible logical screen
' *** if necessary, move fresh screen to new logical screen (last line)
SWAP screen.1%,screen.2%
VSYNC ! necessary to avoid flashes
~XBIOS(5,L:screen.2%,L:screen.1%,-1) ! swap the screens
' BMOVE screen.1%,screen.2%,32000 ! move fresh screen to screen.2
RETURN
' ***
> PROCEDURE restore.physical.screen
' *** restore default situation (logical screen = physical screen)
~XBIOS(5,L:physbase%,L:physbase%,-1)
RETURN
' **********
'
> PROCEDURE screen.black.out
' *** clear screen with shrinking black rectangle
' *** uses Standard Globals
LOCAL i
COLOR black
FOR i=0 TO scrn.y.max/2
BOX i,i,scrn.x.max-i,scrn.y.max-i
NEXT i
COLOR white
FOR i=scrn.y.max/2 DOWNTO 0
BOX i,i,scrn.x.max-i,scrn.y.max-i
NEXT i
COLOR black
RETURN
' **********
'
> PROCEDURE screen.dimmer
' *** dimm screen (during some action)
' *** High resolution only
' *** global : DIMMER.SCREEN$ DIMMER.SWITCH!
IF dimmer.switch!
SPUT dimmer.screen$
' CLR dimmer.screen$ ! if you need space
dimmer.switch!=FALSE
ELSE
SGET dimmer.screen$
GRAPHMODE 4
DEFFILL 1,2,4
PBOX 0,0,639,399
dimmer.switch!=TRUE
ENDIF
RETURN
' **********
'
> PROCEDURE screen.black.lines
' *** clear screen with lines
' *** uses Standard Globals
LOCAL i,j
COLOR black
FOR j=0 TO 9
FOR i=j TO SUCC(scrn.y.max) STEP 10
LINE 0,i,scrn.x.max,i
NEXT i
PAUSE 1
NEXT j
CLS
RETURN
' **********
'
> PROCEDURE screen.black.scroll
' *** clear screen with upwards scrolling black rectangle
' *** uses Standard Globals
LOCAL i
COLOR black
FOR i=scrn.y.max DOWNTO 0
LINE 0,i,scrn.x.max,i
NEXT i
COLOR white
PAUSE 10
FOR i=scrn.y.max DOWNTO 0
LINE 0,i,scrn.x.max,i
NEXT i
COLOR black
RETURN
' **********
'
> PROCEDURE invert.block(x1,y1,x2,y2,color)
' *** invert block (e.g. to acknowledge user's choice)
' *** call Procedure second time (with same parameters) to restore block
GRAPHMODE 3
DEFFILL color,1
BOUNDARY 0
PBOX x1,y1,x2,y2
BOUNDARY 1
GRAPHMODE 1
RETURN
' **********
'
> PROCEDURE block.dimmer(x1,y1,x2,y2,color)
' *** dimm block (e.g. for selection that is temporarily not available)
' *** call Procedure second time (with same parameters) to restore block
GRAPHMODE 3
DEFFILL color,2,2
BOUNDARY 0
PBOX x1,y1,x2,y2
BOUNDARY 1
GRAPHMODE 1
RETURN
' **********
'
> PROCEDURE show.degas(degas$)
' *** put Degas-picture on screen (and use picture-palette)
' *** uses Standard Globals
' *** global : SHOW.DEGAS!
LOCAL r$,degas.picture$,degas.picture%,degas.palette$,degas.palette%
r$=UPPER$(RIGHT$(degas$,3))
IF (high.res! AND r$="PI3") OR (med.res! AND r$="PI2") OR (low.res! AND r$="PI1")
degas.picture$=SPACE$(32000)
degas.picture%=VARPTR(degas.picture$)
degas.palette$=SPACE$(32)
degas.palette%=VARPTR(degas.palette$)
OPEN "I",#90,degas$
SEEK #90,2
BGET #90,degas.palette%,32 ! load palette of picture
SEEK #90,34
BGET #90,degas.picture%,32000 ! load actual picture
CLOSE #90
~XBIOS(6,L:degas.palette%) ! change palette
SPUT degas.picture$ ! show the picture
show.degas!=TRUE ! success
ELSE
show.degas!=FALSE ! failure
ENDIF
RETURN
' **********
'
> PROCEDURE save.degas(file$)
' *** save current screen as Degas-picture
' *** use correct extension (PI1=Low, PI2=Medium, PI3=High)
' *** uses Standard Globals and Standard Procedure Exit
LOCAL screen$,degas.palette$,n%,degas$,res$,m$,k
SGET screen$
file$=UPPER$(file$)
degas.palette$=""
FOR n%=0 TO 15
degas.palette$=degas.palette$+MKI$(XBIOS(7,n%,-1))
NEXT n%
IF high.res! AND RIGHT$(file$,3)="PI3"
res$=MKI$(2)
ELSE IF med.res! AND RIGHT$(file$,3)="PI2"
res$=MKI$(1)
ELSE IF low.res! AND RIGHT$(file$,3)="PI1"
res$=MKI$(0)
ELSE
m$="wrong extension|for Degas|in this|resolution"
ALERT 3,m$,1," OK ",k
@exit
ENDIF
degas$=res$+degas.palette$+screen$
BSAVE file$,VARPTR(degas$),LEN(degas$)
RETURN
' **********
'
> PROCEDURE show.comp.degas(degas.file$)
' *** put compressed Degas-picture on screen (and use picture-palette)
' *** original routine by Jim Kent
' *** uses Standard Globals
' *** global : SHOW.COMP.DEGAS!
LOCAL r$,temp$,p%,temp2$,b%,i%,k%,p%,q%,scr%,screen%
show.comp.degas!=FALSE
'
' *** load UNPAC.INL (60 bytes) here
INLINE unpac%,60
'
' *** load UNRAV.INL (40 bytes) here
INLINE unrav%,40
'
IF degas.file$<>""
r$=UPPER$(RIGHT$(degas.file$,3))
IF EXIST(degas.file$) AND MID$(r$,2,1)="C"
temp$=SPACE$(32760)
p%=VARPTR(temp$)
BLOAD degas.file$,p%
screen%=physbase% ! picture appears on screen while decompressing
temp2$=SPACE$(40)
b%=VARPTR(temp2$)
p%=p%+2
FOR i%=0 TO 15
SETCOLOR i%,DPEEK(p%)
ADD p%,2
NEXT i%
IF high.res! AND r$="PC3"
FOR k%=1 TO 400
scr%=screen%
p%=C:unpac%(L:p%,L:b%,80)
q%=C:unrav%(L:b%,L:scr%,80,2)
ADD screen%,80
NEXT k%
show.comp.degas!=TRUE
ELSE IF med.res! AND r$="PC2"
FOR k%=1 TO 200
scr%=screen%
FOR c%=1 TO 2
p%=C:unpac%(L:p%,L:b%,80)
q%=C:unrav%(L:b%,L:scr%,80,4)
ADD scr%,2
NEXT c%
ADD screen%,160
NEXT k%
show.comp.degas!=TRUE
ELSE IF low.res! AND r$="PC1"
FOR k%=1 TO 200
scr%=screen%
FOR c%=1 TO 4
p%=C:unpac%(L:p%,L:b%,40)
q%=C:unrav%(L:b%,L:scr%,40,8)
ADD scr%,2
NEXT c%
ADD screen%,160
NEXT k%
show.comp.degas!=TRUE
ENDIF
ELSE
ALERT 1,"Can't find|compressed|Degas-file|"+degas.file$,1,"EDIT",button
EDIT
ENDIF
ENDIF
RETURN
' **********
'
> PROCEDURE blend(scrn.adr%,mode%,delay)
' *** fade-over of current screen with other screen (e.g. picture)
' *** mode% determines effect (= stepsize; ≥ 1, ≤ 32000)
' *** try mode% 1,7,8 or 9
' *** delay determines time (≥ 0)
'
' *** load BLEND.INL (68 bytes) here
INLINE blend%,68
'
VOID C:blend%(L:scrn.adr%,L:mode%,delay)
RETURN
' **********
'
> PROCEDURE full.fill(fill$)
' *** fill screen extremely fast with Fill-pattern fill$
' *** use Procedure Initio.fill or Initio.high.fill1 to create fill$
' *** High resolution only
LOCAL fill%
fill%=V:fill$
CLS
ACLIP 1,0,0,639,399
ARECT 0,0,639,399,1,0,fill%,15
ACLIP 0,0,0,639,399
RETURN
' **********
'